package com.trkj.dao.hjj;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojo.Emppass;

public interface EmppassDAO extends CrudRepository<Emppass, Long> {
	
	@Query(nativeQuery=true,value="select e.pass_id,s.stain_name,(select count(*) from RELATIONSHIP_110 r where r.pass_id = e.PASS_ID and r.ROLE_ID=?1) state from emppass e inner join STAFF_INFORMATION s on e.STAIN_ID=s.STAIN_ID inner join LABOR_TURNOVER l on e.stain_id=l.stain_id where l.voluntary_Turnover=0")
	public List<Object[]> queryByrole(Long roleId);
}
